#include "ThreadPoll.hpp"


int main()
{
    // 主线程进行分配任务 , 向线程池分发任务 , 线程池来完成
    ThreadPoll* tp = ThreadPoll::GetThreadPoll();
    tp->Start();
    srand((unsigned int)time(nullptr));

    //sleep(5000);

    while(true)
    {   
        int x = rand() % 100 , y = rand() % 100;
        Task tk(x, y);
        std::cout << "main thread sent a task : " << x << "---" << y << std::endl;
        tp->Push(tk);
        usleep(4000);
    }

    return 0;
}